import openpyxl

myBook=openpyxl.load_workbook('世界五百强表.xlsx',data_only=True)

mySheet=myBook.active
myNewBook=openpyxl.Workbook()
myNewSheet=myNewBook.active
myNewSheet.title='世界五百强表'
myNewSheet.append(['公司名称','夺冠次数'])
myRows=list(mySheet.values)[1:]
myList=[]
for myRow in myRows:
	myList.append(myRow[1])

mySet=set(myList)
for myName in mySet:
	myNewSheet.append([myName,myList.count(myName)])
myNewBook.save('结果表-世界五百强表.xlsx')

